<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据包列表 - 网络流量抓包分析系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">
                <i class="bi bi-router"></i>
                网络流量抓包分析系统
            </a>
            <div class="navbar-nav ms-auto">
                <a class="nav-link" href="/">首页</a>
                <a class="nav-link active" href="packets.html">数据包</a>
                <a class="nav-link" href="statistics.html">统计分析</a>
                <a class="nav-link" href="realtime.html">实时监控</a>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-header">
                        <h5 class="card-title mb-0">
                            <i class="bi bi-collection"></i>
                            数据包列表
                        </h5>
                    </div>
                    <div class="card-body">
                        <!-- 过滤器 -->
                        <div class="row mb-3">
                            <div class="col-md-2">
                                <select id="protocolFilter" class="form-select">
                                    <option value="">所有协议</option>
                                    <option value="TCP">TCP</option>
                                    <option value="UDP">UDP</option>
                                    <option value="HTTP">HTTP</option>
                                    <option value="HTTPS">HTTPS</option>
                                    <option value="DNS">DNS</option>
                                    <option value="DHCP">DHCP</option>
                                    <option value="FTP">FTP</option>
                                    <option value="SSH">SSH</option>
                                    <option value="SMTP">SMTP</option>
                                    <option value="OTHER">其他</option>
                                </select>
                            </div>
                            <div class="col-md-2">
                                <input type="text" id="sourceIpFilter" class="form-control" placeholder="源IP">
                            </div>
                            <div class="col-md-2">
                                <input type="text" id="destIpFilter" class="form-control" placeholder="目标IP">
                            </div>
                            <div class="col-md-2">
                                <input type="number" id="sourcePortFilter" class="form-control" placeholder="源端口">
                            </div>
                            <div class="col-md-2">
                                <input type="number" id="destPortFilter" class="form-control" placeholder="目标端口">
                            </div>
                            <div class="col-md-2">
                                <button id="searchBtn" class="btn btn-primary w-100">
                                    <i class="bi bi-search"></i> 搜索
                                </button>
                            </div>
                        </div>

                        <!-- 数据包表格 -->
                        <div class="fixed-table">
                            <table class="table table-hover table-sm">
                                <thead class="table-dark sticky-top">
                                    <tr>
                                        <th>时间</th>
                                        <th>协议</th>
                                        <th>源地址</th>
                                        <th>目标地址</th>
                                        <th>长度</th>
                                        <th>信息</th>
                                    </tr>
                                </thead>
                                <tbody id="packetTableBody">
                                    <!-- 数据行将通过JavaScript动态生成 -->
                                </tbody>
                            </table>
                        </div>

                        <!-- 分页 -->
                        <nav aria-label="数据包分页" class="mt-3">
                            <ul class="pagination justify-content-center" id="pagination">
                                <!-- 分页按钮将通过JavaScript动态生成 -->
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 数据包详情模态框 -->
    <div class="modal fade" id="packetDetailModal" tabindex="-1">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">数据包详情</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body" id="packetDetailContent">
                    <!-- 详情内容 -->
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="js/common.js"></script>
    <script src="js/packets.js"></script>
</body>
</html>